package com.biaobiaoqi.scoreanalysis.hibernate.bean.pkid;

import javax.persistence.Column;

import com.biaobiaoqi.scoreanalysis.hibernate.bean.Course;
import com.biaobiaoqi.scoreanalysis.hibernate.bean.Examination;
import com.biaobiaoqi.scoreanalysis.hibernate.bean.Student;

public class ScorePKID {
	@Column(nullable=false)
	private Student student;
	@Column(nullable=false)
	private Examination examination;
	@Column(nullable=false)
	private Course course;
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((course == null) ? 0 : course.hashCode());
		result = prime * result
				+ ((examination == null) ? 0 : examination.hashCode());
		result = prime * result + ((student == null) ? 0 : student.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ScorePKID other = (ScorePKID) obj;
		if (course == null) {
			if (other.course != null)
				return false;
		} else if (!course.equals(other.course))
			return false;
		if (examination == null) {
			if (other.examination != null)
				return false;
		} else if (!examination.equals(other.examination))
			return false;
		if (student == null) {
			if (other.student != null)
				return false;
		} else if (!student.equals(other.student))
			return false;
		return true;
	}
	public Student getStudent() {
		return student;
	}
	public void setStudent(Student student) {
		this.student = student;
	}
	public Examination getExamination() {
		return examination;
	}
	public void setExamination(Examination examination) {
		this.examination = examination;
	}
	public Course getCourse() {
		return course;
	}
	public void setCourse(Course course) {
		this.course = course;
	}
}
